package com.huike.web.controller.rule;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.huike.clues.domain.TbRulePool;
import com.huike.clues.domain.dto.TbRulePoolDTO;
import com.huike.clues.service.TbRulePoolService;
import com.huike.common.core.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @Description 线索或商机池规则相关接口
 * @Date 2023-10-10
 */

@Api(tags = "线索商机规则")
@RequestMapping("/rule/pool")
@RestController
public class TbRulePoolController {

    @Resource
    private TbRulePoolService tbRulePoolService;

    @ApiOperation("查询规则信息")
    @GetMapping("/{type}")
    public TbRulePool getTbRule(@PathVariable String type){
        TbRulePool data = tbRulePoolService.getTbRule(type);
        return data;
    }

    @ApiOperation("修改线索池规则")
    @PutMapping()
    public AjaxResult updatePoolRule(@RequestBody TbRulePoolDTO tbRulePoolDTO){
        tbRulePoolService.updatePoolRule(tbRulePoolDTO);
        return AjaxResult.success();
    }

}
